using System;
using System.Windows.Forms;

namespace Tino
{
    public partial class PreferencesForm : Form
    {
        public PreferencesForm()
        {
            InitializeComponent();

            restoreSettings();
        }

        void restoreSettings()
        {
            startupCombo.SelectedIndex = (Globals.Get().ShowWelcome ? 0 : 1);
        }

        bool saveSettings()
        {
            Globals.Get().ShowWelcome = (startupCombo.SelectedIndex == 0);
            return true;
        }

        void okButton_Click(object sender, EventArgs e)
        {
            if (saveSettings())
                Close();
        }

        void cancelButton_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}